package com.feng.profile.factory;

import java.util.LinkedHashMap;

/**
 * 权限工厂
 * @author Lee
 */
public class FilterChainDefinitionMapBuilder {

    public LinkedHashMap<String,String> builderFilterChainDefinitionMap(){
        LinkedHashMap<String,String> filterChainDefinitionMap = new LinkedHashMap<>();
        filterChainDefinitionMap.put("/login.jsp", "anon");
        filterChainDefinitionMap.put("/sys/user/addUser.do", "anon");
        filterChainDefinitionMap.put("/sys/user/login.do", "anon");
        filterChainDefinitionMap.put("/sys/captcha.jpa", "anon");
        filterChainDefinitionMap.put("/logout", "logout");
        filterChainDefinitionMap.put("/admin.jsp", "authc,roles[admin]"); //认证且是admin用户
        filterChainDefinitionMap.put("/user.jsp", "authc,roles[user]");   //认证且是user用户
        filterChainDefinitionMap.put("/list","user"); //记住我就可以访问
        filterChainDefinitionMap.put("/resources/**","anon");
        filterChainDefinitionMap.put("/druid/**","anon");
        filterChainDefinitionMap.put("/**", "authc");

        return filterChainDefinitionMap;
    }

}
